<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <title>小猫咪编码转换</title>
  <meta name="keywords" content="base64编码转换,unicode编码转换,二进制转换,url编码解码">
  <meta name="description" content="一款免费的字符编码解码程序，包括base64编码转换，unicode编码转换，二进制转换，url编码解码">
  <meta name="author" content="云猫" />
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
  <link rel="stylesheet" href="layui/css/layui.css">
  <link rel="stylesheet" href="layui/css/index.css">
  <script src="https://cdn.lwcat.cn/jquery/jquery.js"></script>
  <style>
    .container {
      padding-top: 15px;
      max-width: 100%;
    }
    .col-xs-12, .col-sm-10, .col-md-8, .col-lg-6 {
      width: 100%;
    }
    .panel {
      width: 100%;
    }
    #inputText, #outputText {
      width: 100%;
      height: 100px;
      margin: 10px 0;
      resize: none;
    }
    #convertButton, #copyButton {
      width: 100%;
      margin: 10px 0;
    }
    .layui-form-select, .layui-btn {
      width: 100%;
    }
    select {
      width: 100%;
      margin: 10px 0;
    }
  </style>
</head>
<body>
  <div class="demo-login-container">
    <div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 center-block">
      <div class="panel panel-default">
        <div class="layui-elem-quote" style="text-align: center;">
          <h3 class="panel-title"><span id="loginmsg">小猫咪编码转换</span></h3>
        </div>
        <div class="panel-body">
          <div class="layui-elem-quote" role="alert">
            <span class="alert-inner--icon"><i class="layui-icon"></i></span>
            <span class="alert-inner--text">
              <strong>注意：</strong><em>平台支持编码和解码，如果发现解码失败，请检查你的内容是否完整</em>
            </span>
          </div>
          <div class="container">
            <textarea id="inputText" class="layui-textarea" placeholder="输入要转换的字符..."></textarea>
            
            <div class="layui-form layui-row layui-col-space16">
              <div class="layui-col-md12">
                <select id="conversionType">
                <option value="base64_encode">请选择操作</option>
                  <option value="base64_encode">Base64 编码</option>
                  <option value="base64_decode">Base64 解码</option>
                  <option value="url_encode">URL 编码</option>
                  <option value="url_decode">URL 解码</option>
                  <option value="binary_encode">二进制 编码</option>
                  <option value="binary_decode">二进制 解码</option>
                  <option value="unicode_encode">Unicode 编码</option>
                  <option value="unicode_decode">Unicode 解码</option>
                </select>
              </div>
            </div>
            
            <button id="convertButton" class="layui-btn">转换</button>
            <textarea id="outputText" class="layui-textarea" placeholder="转换结果..." readonly></textarea>
            <button id="copyButton" class="layui-btn layui-btn-normal">一键复制</button>
          </div>
          <center>
            <code id="xiaoyiyan">(〃'▽'〃)获取中...</code>
          </center>
        </div>
      </div>
    </div>
  </div>
<script>
$(document).ready(function() {
    function fetchSentence() {
        $.getJSON("https://api.lwcat.cn/api/sentence.php?format=json", function(data) {
            if(data.code === 1) {
                $('#xiaoyiyan').text(data.result);
            } else {
                $('#xiaoyiyan').text("(╥_╥) 获取失败");
            }
        })
        .fail(function() {
            $('#xiaoyiyan').text("(╥_╥) 请求失败");
        });
    }

    fetchSentence();

    $('#convertButton').click(function() {
        fetchSentence();
    });
        $('#copyButton').click(function() {
        fetchSentence();
    });
});
</script> 
  <script src="layui/layui.js"></script>
  <script src="script.js"></script>
  <br>
  <center>
    <p>Copyright © 2024 <a href="/">云猫</a></p>
    <p id="LAY-footer-info">
      <a href="https://beian.miit.gov.cn/" target="_blank">粤ICP备2023154257号</a>|&nbsp&nbsp<a href="https://gitee.com/ximami/code/" target="_blank">开源地址</a>
    </p>
  </center>
</body>
</html>